<table width="100%">
  <tr>
    <td>
      <font class="regulartext" style="font-size: 16pt;">
        <%= @ad.title %>
        <%= ad_link(@ad,"#{root_url}/#{@ad.to_param}") %>
      </font>
      <br/>
      <font class="regulartext">
        <% @ad.categories.each do |c| %>
          <%= category_path(c) %><br />
        <% end %>
        Säljes i <%= @ad.user.county.name%>, <%= @ad.user.county.province.name %>.
      </font>
      <br />

    </td>
  </tr>
  <tr>
    <td class="regulartext" style="text-align: center;">
      <%= render_table(:entities => @ad.pictures,
        :width_area => 700,
        :width_entity => 150,
        :partial => "view_image") %>
    </td>
  </tr>
  <tr>
    <td class="regulartext" style="text-align: center;">
      <%= decode_string(@ad.description) %><br/>
      <br/>
      <%= render_remote_url("/partial/ad/ad_info/#{@ad.id}") %>
    </td>
  </tr>
  <tr>
    <td class="regulartext">
      &nbsp;
    </td>
  </tr>
  <% if @ad.enddate > Time.now && @ad.ad_status_id != 5 %>
    <tr>
      <td>
        <% if @ad.auction %>
          <%= render :partial => "auction" %>
        <% elsif @ad.fixed %>
          <%= render :partial => "fixed" %>
        <% elsif @ad.relaxed %>
          <%= render :partial => "relaxed" %>
        <% end %>
      </td>
    </tr>
    <tr>
      <td class="regulartext">
        &nbsp;
      </td>
    </tr>
    <tr>
      <td class="regulartext">
        <table width="100%" class="dottedbox">
          <tr>
            <td class="regulartext" width="350">
              Säljaren erbjuder följande alternativ för frakt:<br />
              <% @ad.ad_shipping_methods.each do |m| %>
                <li>Med <%=m.shipping_method.name%> inom <%=m.shipping_area.name%> för <%=m.price%> kr</li>
              <% end %>
            </td>
            <td class="regulartext" width="100">
              &nbsp;
            </td>
            <td class="regulartext" width="350">
              Säljaren erbjuder följande alternativ för betalning:<br />
              <% @ad.payment_methods.each do |m| %>
                <li><%=m.name%></li>
              <% end %>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td class="regulartext">
        <table>
          <tr>
            <td width="290">
              <%= render :partial => "userinfo", :locals => { :user => @ad.user } %>
            </td>
            <td width="10">

            </td>
            <td width="500" style="text-align: right;">
              <div id="report">
                <%= render :partial => "report", :locals => { :ad_id => @ad.id } %>
              </div>
              <br/>
              <%= render_remote_url("/partial/ad/subscription/#{@ad.id}","spinner_tiny") %>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td class="regulartext">
        <div id="contact">
          <%= render :partial => "contact", :locals => { :ad => @ad } %>
        </div>
      </td>
    </tr>
  <% end %>
</table>